package com.fox0g.mapper;

import com.fox0g.pojo.Farm;
import com.fox0g.pojo.Profit;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fox0g.pojo.Tstate;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 86176
* @description 针对表【profit(盈利额)】的数据库操作Mapper
* @createDate 2024-07-07 10:21:40
* @Entity com.fox0g.pojo.Profit
*/

@Mapper
public interface ProfitMapper extends BaseMapper<Profit> {
    @Insert("insert into test.profit(money,createt_time)" +
            " values (#{money},#{createtTime})")
    int insert(Profit profit) ;


    @Select("select createt_time,sum(money) as money from test.profit group by createt_time order by createt_time desc ")
    List<Profit> profitAllData();
}




